package cloud.seri.iot.manager.service.mapper

import cloud.seri.iot.manager.domain.Commodity
import cloud.seri.iot.manager.service.dto.CommodityDTO

import org.mapstruct.Mapper
import org.mapstruct.Mapping
import org.mapstruct.Mappings

/**
 * Mapper for the entity [Commodity] and its DTO [CommodityDTO].
 */
@Mapper(componentModel = "spring", uses = [])
interface CommodityMapper : EntityMapper<CommodityDTO, Commodity> {


    fun fromId(id: String?): Commodity? {
        if (id == null) {
            return null
        }
        val commodity = Commodity()
        commodity.id = id
        return commodity
    }
}
